package com.yao.shop.exception;

import com.yao.shop.enums.ResultEnums;

/**
 * 自定义异常
 */
public class PochiException extends RuntimeException {
    private  Integer errCode= ResultEnums.ERROR.getCode();

    public PochiException(ResultEnums resultEnums){
        super(resultEnums.getMsg());
        this.errCode=resultEnums.getCode();
    }

    public PochiException(ResultEnums resultEnums,Throwable throwable){
        super(resultEnums.getMsg(),throwable);
        this.errCode=resultEnums.getCode();
    }
    public PochiException(Integer code,String msg){
        super(msg);
        this.errCode=code;
    }

    public PochiException(Throwable throwable){
        super(throwable);
    }
    public PochiException(String msg){
        super(msg);
    }

    public Integer getErrCode(){
        return errCode;
    }

    public void setErrCode(Integer errCode){
        this.errCode=errCode;
    }


}
